#include <57header.h>

/* Usage: 01_fopen filename */
int main(int argc, char *argv[]){
    ARGS_CHECK(argc, 2);
    FILE *fp = fopen(argv[1], "w+");
    ERROR_CHECK(fp, NULL, "fopen");
    
    // fileno函数用于获取文件流当中的文件描述符
    int fd = fileno(fp);
    printf("fd = %d\n", fd);
    int ret = write(3, "hello", 5);
    ERROR_CHECK(ret, -1, "write");

    return 0;
}

